package com.company;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.net.URL;

/**
 * Created by v on 17-7-9.
 */
public class Image {
    private static String relativePaths="file:/home/v/IdeaProjects/plane/src/com/company/image/";

    //图像类型
    public static BufferedImage background;
    public static BufferedImage start;
    public static BufferedImage airplane;
    public static BufferedImage bee;
    public static BufferedImage bullet;
    public static BufferedImage hero0;
    public static BufferedImage hero1;
    public static BufferedImage pause;
    public static BufferedImage gameover;



    static {
        try {
            background=ImageIO.read(new URL(relativePaths+"background.png"));
            start=ImageIO.read(new URL(relativePaths+"start.png"));
            airplane=ImageIO.read(new URL(relativePaths+"airplane.png"));
            bee=ImageIO.read(new URL(relativePaths+"bee.png"));
            bullet=ImageIO.read(new URL(relativePaths+"bullet.png"));
            hero0=ImageIO.read(new URL(relativePaths+"hero0.png"));
            hero1=ImageIO.read(new URL(relativePaths+"hero1.png"));
            pause=ImageIO.read(new URL(relativePaths+"pause.png"));
            gameover=ImageIO.read(new URL(relativePaths+"gameover.png"));
        }catch (Exception ex){
            ex.printStackTrace();
        }
    }
}
